#include "user_main.h"

uint8_t tSysSecond = 0;
uint8_t tSysMinute= 0;
uint8_t tSysHour = 0;


void System_BaseTime(void)
{
	static uint8_t tick = 0;

	if(Flag_5ms)
	{
		Flag_5ms = 0;

		Display_BaseTime();
		tick++;
		if (tick >= 200) // 200*5ms=1000ms=1s
		{
			tick = 0;
			tSysSecond++;
			if (tSysSecond >= 60)
			{
				tSysSecond = 0;
				tSysMinute++;
				if (tSysMinute >= 60)
				{
					tSysMinute = 0;
					tSysHour++;
				}
			}
		}
	}
}

void MainLoop(void)
{

	while(1)
	{
		Display();
		System_BaseTime();
		FL_IWDT_ReloadCounter(IWDT);
	}
}


